<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        var age = [1,2,3,4,5] ;  // 字面量声明

        console.log(age) ;

        var age = new Array(1,2,3,4,5) ;  // 实例化对象

        console.log(age) ;


        //new Array()  括号里面只有一个数的时候，表示的是数组的长度
        var age = new Array(5) ;

        console.log(age) ;

        console.log(age[0]) ;   // undefined



        var str = 'hello' ;

        var str2 = new String('hello') ;


        console.log(str) ;      // string  
        console.log(str2) ;    // object   字符串对象

        // var num = new Number(1) ;

        // var bool = new Boolean(true) ;

    </script>
    
</body>
</html>